package com.edfu.core.coursemgt.persistence.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.edfu.core.identitymgt.persistence.entity.CohortEntity;
import com.edfu.core.identitymgt.persistence.entity.UserEntity;

@Entity
@Table(name="enrollment")
public class MeetingEnrollmentEntity implements ICourseMgtEntity {
	private long id;
	private UserEntity user;
	private String status; 
	private boolean partOfCohort ;
	private CohortEntity cohortIfAny;
	private MeetingEntity meeting;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false)
	public UserEntity getUser() {
		return user;
	}
	public void setUser(UserEntity user) {
		this.user = user;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public boolean isPartOfCohort() {
		return partOfCohort;
	}
	public void setPartOfCohort(boolean partOfCohort) {
		this.partOfCohort = partOfCohort;
	}
	@ManyToOne
	@JoinColumn(name = "cohort_id", nullable = true)
	public CohortEntity getCohortIfAny() {
		return cohortIfAny;
	}
	public void setCohortIfAny(CohortEntity cohortIfAny) {
		this.cohortIfAny = cohortIfAny;
	}
	
	@ManyToOne
	@JoinColumn(name = "meeting_id", nullable = true)
	public MeetingEntity getMeeting() {
		return meeting;
	}
	public void setMeeting(MeetingEntity meeting) {
		this.meeting = meeting;
	}
}
